<?php

namespace App\Handlers;

use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Redis;

class HaiweiHandler
{
    public static function setLatestData($data){
// error_log("joker = ".print_r($data['_terminalTime'],1)."\n",3,'/tmp/joker.log');
        foreach ($data as $one) {
            $key = $one['_groupTag'];
            foreach ($one as $alias => $val) {
                if ($alias == '_terminalTime' || $alias == '_groupTag') {
                    continue;
                }
                $v[$alias] = round($val, 3);
            }
            Redis::set($key, json_encode($v));
        }
    }
}